package com.example.framework.utils;

import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.view.View;

/**
 * @author:0.2℃
 * @date： 2022-03-28 16:41
 * @Description ：沉浸式实现
 */
public class SystemUI {
    public static void fixSystemUI(Activity mActivity) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            // 获得顶部VIew
            mActivity.getWindow().getDecorView()
                    .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                                            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE)    ;
            mActivity.getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
    }
}
